import {JSEncrypt} from "jsencrypt";
import request from "@/utils/requset";

const encrypt = (publicKey, stringMessage) => {
    let encryptor = new JSEncrypt();
    //设置公钥
    encryptor.setPublicKey(publicKey);
    //加密并返回
    stringMessage = encryptor.encrypt(stringMessage);
    return stringMessage;
}

export default encrypt